package net.openvision.util;

public class Pair<A, B> {
	private A first;
	private B second;
	
	public Pair(A first, B second)  {
		this.first = first;
		this.second = second;
	}
	
	public A getFirst() {
		return first;
	}
	
	public B getSecond() {
		return second;
	}
	
	public void setFirst(A a) {
		first = a;
	}
	
	public void setSecond(B b) {
		second = b;
	}
	
	@Override
	public boolean equals(Object o) {
		if (!(o instanceof Pair))
			return false;
		Pair<A,B> p = (Pair<A,B>)o;
		return p.first.equals(first) && p.second.equals(second);
	}
	
	@Override
	public int hashCode() {
		return first.hashCode() + second.hashCode();
	}
}
